aprutil_build_rule = """

cc_library(
    name = "aprutil",
    srcs = [
        "@mod_pagespeed//third_party/aprutil:aprutil_pagespeed_memcache_c",
        'buckets/apr_brigade.c',
        'buckets/apr_buckets.c',
        'buckets/apr_buckets_alloc.c',
        'buckets/apr_buckets_eos.c',
        'buckets/apr_buckets_file.c',
        'buckets/apr_buckets_flush.c',
        'buckets/apr_buckets_heap.c',
        'buckets/apr_buckets_mmap.c',
        'buckets/apr_buckets_pipe.c',
        'buckets/apr_buckets_pool.c',
        'buckets/apr_buckets_refcount.c',
        'buckets/apr_buckets_simple.c',
        'buckets/apr_buckets_socket.c',
        'crypto/apr_md5.c',
        'crypto/getuuid.c',
        'crypto/uuid.c',
        #'dbm/apr_dbm.c',
        #'dbm/apr_dbm_sdbm.c',
        #'dbm/sdbm/sdbm.c',
        #'dbm/sdbm/sdbm_hash.c',
        #'dbm/sdbm/sdbm_lock.c',
        #'dbm/sdbm/sdbm_pair.c',
        'encoding/apr_base64.c',
        'hooks/apr_hooks.c',
        #'ldap/apr_ldap_stub.c',
        #'ldap/apr_ldap_url.c',
        'memcache/apr_memcache.c',
        'misc/apr_date.c',
        'misc/apr_queue.c',
        'misc/apr_reslist.c',
        'misc/apr_rmm.c',
        'misc/apr_thread_pool.c',
        'misc/apu_dso.c',
        'misc/apu_version.c',
        'strmatch/apr_strmatch.c',
        'uri/apr_uri.c',
        'xlate/xlate.c',
    ],
    hdrs = [
        "@mod_pagespeed//third_party/aprutil:aprutil_pagespeed",
        "crypto/crypt_blowfish.h",
        #"test/test_apu.h",
        #"test/abts_tests.h",
        #"test/testutil.h",
        #"test/abts.h",
        "dbm/sdbm/sdbm_private.h",
        "dbm/sdbm/sdbm_pair.h",
        "dbm/sdbm/sdbm_tune.h",
        "include/apr_siphash.h",
        "include/apr_dbm.h",
        "include/apr_xlate.h",
        "include/apr_ldap_url.h",
        "include/apu_version.h",
        "include/apr_redis.h",
        "include/private/apr_dbd_odbc_v2.h",
        "include/private/apr_dbm_private.h",
        "include/private/apu_internal.h",
        "include/private/apr_dbd_internal.h",
        "include/private/apr_crypto_internal.h",
        "include/apr_md5.h",
        "include/apu_errno.h",
        "include/apr_xml.h",
        "include/apr_sdbm.h",
        "include/apr_md4.h",
        "include/apr_hooks.h",
        "include/apr_date.h",
        "include/apr_reslist.h",
        "include/apr_memcache.h",
        "include/apr_uuid.h",
        "include/apr_base64.h",
        "include/apr_sha1.h",
        "include/apr_uri.h",
        "include/apr_queue.h",
        "include/apr_ldap_option.h",
        "include/apr_optional.h",
        "include/apr_dbd.h",
        "include/apr_anylock.h",
        "include/apr_strmatch.h",
        "include/apr_optional_hooks.h",
        "include/apr_thread_pool.h",
        "include/apr_buckets.h",
        "include/apr_rmm.h",
        "include/apr_ldap_rebind.h",
        "include/apr_ldap_init.h",
        "include/apr_crypto.h",
    ],
    copts = [
      "-Ithird_party/aprutil/gen/arch/linux/x64/include/",
      "-Ithird_party/aprutil/gen/arch/linux/x64/include/private",
      "-Iexternal/aprutil/include/",
      "-Iexternal/aprutil/include/private/",
      "-Iexternal/aprutil/include/arch/unix/",
      "-Iexternal/aprutil/",
      "-Iexternal/apr/include/",
      "-Iexternal/apr/include/arch/unix/",
      "-Ithird_party/apr/gen/arch/linux/x64/include/",
    ],
    deps = [
        "@apr//:apr",
    ],
    visibility = ["//visibility:public"],
)
"""

# find | grep .h$ | while read line; do echo "\"$line\","; done 